/*
	This program is free software; you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation; either version 2 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU Library General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program; if not, write to the Free Software
	Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
*/

#ifndef TEMPLATESMANAGERDLGIMPL_H
#define TEMPLATESMANAGERDLGIMPL_H
//
#include <QDialog>
#include "ui_templatesmanagerdlg.h"

#include "templatesmodel.h"
//
class TemplatesManagerDlgImpl : public QDialog, public Ui::TemplatesManagerDlg
{
Q_OBJECT
public:
	TemplatesManagerDlgImpl( QWidget * parent = 0, Qt::WFlags f = 0 );
	
	void setManager(TemplateManager *manager);
	void setCurrentCursor(QTextCursor *textCursor);
private slots:
	void on_tbSelected_clicked();
	void on_btnInsert_clicked();
	void on_tbRename_clicked();
	void on_tbDelete_clicked();
	void on_tbMoveDown_clicked();
	void on_tbMoveUp_clicked();
	void on_lwTemplates_currentItemChanged(QListWidgetItem* current, QListWidgetItem* previous);
	void onFinished(int result);
private:
	TemplateManager *m_templatesManager;
	
	QTextCursor *m_currentCursor;
	
	void updateList();
	void updateUIFromModel(int index);
};
#endif





